<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>鼠标经过切换图片</title>

    <script>
        window.onload = function () {
            var pic = document.getElementById("pic");
            pic.onmouseover = function () {
                pic.src = "images/jd2.png";
            }
            pic.onmouseout = function () {
                pic.src = "images/jd1.png";
            }
        }
    </script>
</head>
<body>
<img src="images/jd1.png" alt="" id="pic">
</body>
</html>